﻿using System;
using System.Collections.Generic;
using XCI.Sys.Model;
using XCI.Core;
using XCI.Windows.Extensions;
using XCI.Sys.Filter;

namespace XCI.Sys.Service
{
    /// <summary>
    /// 系统日志服务
    /// </summary>
    public class LogService : BaseService<SysLog>
    {
        public static readonly LogService Instance = new LogService();
        protected override string RootUrl => "/api/sys/log/";

        /// <summary>
        /// 根据主键获取日志对象
        /// </summary>
        /// <param name="id">日志主键</param>
        public SysLog SelectById(string id)
        {
            return SelectByIdCore(id);
        }

        /// <summary>
        /// 查询日志分页列表
        /// </summary>
        /// <param name="paged">分页参数</param>
        /// <param name="filter">日志过滤条件</param>
        public PageList<SysLog> SelectPageList(PageParam paged, LogFilter filter)
        {
            var map = ToPageMap(paged).AddObject(filter);
            return SelectPageListCore(map);
        }
    }
}
